class Person {
    private _name: string
    private _age: number

    constructor(_name: string, _age: number) {
        this._name = _name
        this._age = _age
    }

    set name(newName: string) {
        this._name = newName
    }

    get name(): string {
        return this._name
    }

    set age(newAge: number) {
        this._age = newAge
    }

    get age(): number {
        return this._age
    }
}

const p: Person = new Person("陶品奇", 22)
console.log(p)
console.log(p.name,p.age)